public class CpclCmd extends Cmd
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
Lateral_Resolution |
static java.lang.String |
Vertical_Resolution |
Constructor and Description |
---|
CpclCmd() |
Modifier and Type | Method and Description |
---|---|
byte[] |
CPCL_BOX(int x0,
int y0,
int x1,
int y1,
int width)
用户可以使用 BOX 命令生成具有指定线条宽度的矩形
|
byte[] |
CPCL_LINE(int x0,
int y0,
int x1,
int y1,
int width)
CPCL drawLine
画线 |
void |
CPCL_QRCODE(java.lang.String command,
java.lang.String x,
java.lang.String y,
java.lang.String Mn,
java.lang.String Un,
java.lang.String data)
打印二维码
|
void |
Cpcl_VBARCODE(java.lang.String barcodetype,
java.lang.String width,
java.lang.String ratio,
java.lang.String height,
java.lang.String x,
java.lang.String y,
java.lang.String data)
能够以指定的宽度和高度纵向打印条码。 用法同 Cpcl_BARCODE
|
byte[] |
getAllCutCmd()
For Esc
全切 All cut |
byte[] |
getBarcodeCmd(BarcodeType barcodeType,
BarcodeSetting barcodeSetting,
java.lang.String barcodeContent)
Get Barcode Printing command
获取条码打印指令(含二维码) |
byte[] |
getBeepCmd()
For Esc
蜂鸣 Beep |
byte[] |
getBitmapCmd(BitmapSetting bitmapSetting,
android.graphics.Bitmap bitmap)
获取图片打印的指令
Get Bitmap printing command |
byte[] |
getCommonSettingCmd(CommonSetting commonSetting)
获取通用设置的指令
Common Setting command |
byte[] |
getCpclHeaderCmd(int pageWidth,
int pageHigh,
int printCopies,
int offset)
For Cpcl Inital Command
|
byte[] |
getCRCmd()
\r 回车
Enter |
byte[] |
getDrawBox(int x0,
int y0,
int x1,
int y1,
int lineWidth)
Draw Box.[For TSC, CPCL, ZPL]
|
byte[] |
getDrawLine(int x0,
int y0,
int x1,
int y1,
int lineWidth)
For TSC, CPCL, ZPL
Draw a line.[only support Horizontal lines and straight lines]. |
byte[] |
getEndCmd()
获取结束指令(针打则为退纸)
End command |
byte[] |
getHalfCutCmd()
For Esc
半切 Half cut |
byte[] |
getHeaderCmd()
获取指令头(通常是打印机初始化指令)
Get header commands Tsc: CLS command , clear cache Esc/Pin: printer initialization |
byte[] |
getLFCmd()
\n 换行
Wrap |
byte[] |
getLFCRCmd()
换行+回车
Wrap + Enter |
byte[] |
getOpenMoneyBoxCmd()
For Esc
钱箱 Open Money Box |
byte[] |
getPrintCopies(int printCopies)
设置打印份数,Print Copies Setting(For Tsc)
|
byte[] |
getReverse(int x0,
int y0,
int x1,
int y1)
For TSC
功能:将图像缓存中指定的区域做反相的动作 Function: Invert the specified area in the image buffer |
byte[] |
getSelfTestCmd()
打印自测页
Test page print
|
byte[] |
getTextCmd(TextSetting textSetting,
java.lang.String text)
获取文本打印的指令
Print text command |
byte[] |
getTextCmd(TextSetting textSetting,
java.lang.String text,
java.lang.String chartSetName)
获取文本打印的指令
Print text command |
append, arrayAddToList, clear, getAppendCmds, getChartsetName, getOpenMoneyBoxCmd, getPrint80StausCmd, getPrintStausCmd, getVerifiedStr, listToArray, setChartsetName
public static java.lang.String Lateral_Resolution
public static java.lang.String Vertical_Resolution
public byte[] getSelfTestCmd()
Cmd
getSelfTestCmd
in class Cmd
public byte[] getHeaderCmd()
Cmd
getHeaderCmd
in class Cmd
public byte[] getCpclHeaderCmd(int pageWidth, int pageHigh, int printCopies, int offset)
Cmd
getCpclHeaderCmd
in class Cmd
pageWidth
- In-mmpageHigh
- In-mmprintCopies
- range: 0 ~ npublic byte[] getPrintCopies(int printCopies) throws SdkException
Cmd
getPrintCopies
in class Cmd
printCopies
- Default:1SdkException
public byte[] getEndCmd()
Cmd
public byte[] getLFCmd()
Cmd
public byte[] getCRCmd()
Cmd
public byte[] getLFCRCmd()
Cmd
getLFCRCmd
in class Cmd
public byte[] getCommonSettingCmd(CommonSetting commonSetting)
Cmd
getCommonSettingCmd
in class Cmd
public byte[] getTextCmd(TextSetting textSetting, java.lang.String text, java.lang.String chartSetName) throws java.io.UnsupportedEncodingException
Cmd
getTextCmd
in class Cmd
textSetting
- 文本设置, Text Settingtext
- 文本内容,ContentchartSetName
- 文本编码,GBK[Default]、UTF-8java.io.UnsupportedEncodingException
public byte[] getTextCmd(TextSetting textSetting, java.lang.String text) throws java.io.UnsupportedEncodingException
Cmd
getTextCmd
in class Cmd
textSetting
- 文本设置text
- 文本内容,编码使用 chartsetName设置,默认为GBK, chartsetname setting, default:GBKjava.io.UnsupportedEncodingException
public byte[] getBitmapCmd(BitmapSetting bitmapSetting, android.graphics.Bitmap bitmap) throws SdkException
Cmd
getBitmapCmd
in class Cmd
bitmapSetting
- 图片设置(限宽), Bitmap setting (width limit)bitmap
- 要打印的图片 the bitmap which to printSdkException
public byte[] getBarcodeCmd(BarcodeType barcodeType, BarcodeSetting barcodeSetting, java.lang.String barcodeContent) throws SdkException
Cmd
getBarcodeCmd
in class Cmd
barcodeType
- 条码类型barcodeSetting
- 条码设置barcodeContent
- 条码内容SdkException
public byte[] getBeepCmd()
Cmd
getBeepCmd
in class Cmd
public byte[] getAllCutCmd()
Cmd
getAllCutCmd
in class Cmd
public byte[] getHalfCutCmd()
Cmd
getHalfCutCmd
in class Cmd
public byte[] getDrawLine(int x0, int y0, int x1, int y1, int lineWidth)
Cmd
getDrawLine
in class Cmd
x0
- start coordinate-xy0
- start coordinate-yx1
- end coordinate-xy1
- end coordinate-ylineWidth
- line width in Dot.public byte[] getDrawBox(int x0, int y0, int x1, int y1, int lineWidth)
Cmd
getDrawBox
in class Cmd
x0
- left-top of box coordinate-xy0
- left-top of box coordinate-yx1
- right-bottom of box coordinate-xy1
- right-bottom of box coordinate-ylineWidth
- the line width of box, in dot.public byte[] getOpenMoneyBoxCmd()
Cmd
getOpenMoneyBoxCmd
in class Cmd
public void Cpcl_VBARCODE(java.lang.String barcodetype, java.lang.String width, java.lang.String ratio, java.lang.String height, java.lang.String x, java.lang.String y, java.lang.String data)
barcodetype
- width
- ratio
- height
- x
- y
- data
- public void CPCL_QRCODE(java.lang.String command, java.lang.String x, java.lang.String y, java.lang.String Mn, java.lang.String Un, java.lang.String data)
command
- :从下面选择一项:
BARCODE(或 B):横向打印条码。
VBARCODE(或 VB):纵向打印条码。x:
- 横向起始位置。y
- 纵向起始位置Mn
- QR Code 规范编号。选项是 1 或 2。QR Code Model 1 是原始规范,而 QR Code Model 2 则是该符号
的经过增强后的形式。Model 2 提供了附加功能,而且可以自动与 Model 1 进行区分。Model 2 为推荐规范,是
默认值。Un
- 模块的单位宽度/单位高度。
范围是 1 至 32。默认值为 6。data
- 提供生成 QR Code 所需的信息。请参见下面的示例。
{data} 除了包含实际的输入数据字符串外,还包含一些模式选择符号。输入数据类型可以由打印机软件
自动识别,也可以通过手动方式设置。模式选择符号和实际数据之间有一个分隔符(逗号)。
用于自动选择数据类型的数据字段格式:
public byte[] CPCL_LINE(int x0, int y0, int x1, int y1, int width)
x0
- 左上角的 X 坐标。y0
- 左上角的 Y 坐标。x1
- 以下项的 X 坐标:
- 水平轴的右上角。
- 垂直轴的左下角y1
- 以下项的 Y 坐标:
- 水平轴的右上角。
- 垂直轴的左下角。width
- 线条的单位宽度。public byte[] CPCL_BOX(int x0, int y0, int x1, int y1, int width)
x0
- 左上角的 X 坐标。y0
- 左上角的 Y 坐标。x1
- 右下角的 X 坐标。y1
- 右下角的 Y 坐标。width
- 形成矩形框的线条的单位宽度。public byte[] getReverse(int x0, int y0, int x1, int y1)
Cmd
getReverse
in class Cmd
x0
- start coordinate-xy0
- start coordinate-yx1
- end coordinate-xy1
- end coordinate-y